<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>

	<form:form action="/Users" method="POST" modelAttribute="users">

		<form:errors path="*"></form:errors>
		<br>

		<c:if test="${users.id == null }">
		</c:if>

		<c:if test="${users.id != null }">
			<%-- <form:hidden path="id" /> --%>
			ID:<form:input path="id" />
			<input type="hidden" name="_method" value="PUT" />
			<!-- 对于 _method 不能使用 form:hidden 标签, 因为 modelAttribute 对应的 bean 中没有 _method 这个属性 -->
			<%-- <form:hidden path="_method" value="PUT"/> --%>
		</c:if>
		<br>
		<!-- path 属性对应 html 表单标签的 name 属性值 -->
		UserName: <form:input path="username" />
		<form:errors path="username"></form:errors>
		<br>
		Password: <form:password path="password" />
		<form:errors path="password"></form:errors>
		<br>		
		Status:
		<form:radiobuttons path="status" items="${status }" delimiter=" " />
		<br>
		Descn:
		<form:checkboxes path="descn" items="${desc }" delimiter=" " />
		<br>
		<input type="submit" value="Submit" />
	</form:form>